/**
 * Create by yxk at 2020/6/9
 */
import request from '@/utils/request'

/**
 * 采购订单详情
 */
export function jxcPurchaseQueryByIdAPI(data) {
  return request({
    url: `jxcPurchase/queryById/${data.label}`,
    method: 'post',
    data: data
  })
}

/**
 * 采购订单新建/编辑
 */
export function jxcPurchaseAddOrUpdateAPI(data, isUpdate = false) {
  return request({
    url: 'jxcPurchase/addOrUpdate' + (isUpdate ? '/update' : '/add'),
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 采购订单删除
 */
export function jxcPurchaseDeleteByIdsAPI(data) {
  return request({
    url: 'jxcPurchase/deleteByIds',
    method: 'post',
    data: data
  })
}

/**
 * 采购订单删除
 */
export function jxcPurchaseQueryChasProductListAPI(data) {
  return request({
    url: 'jxcPurchasesProduct/queryChasProductList',
    method: 'post',
    data: data
  })
}

/**
 * 采购订单入库记录
 */
export function jxcPurchaseQueryRecordAPI(data) {
  return request({
    url: 'jxcPurchase/queryRecord',
    method: 'post',
    data: data
  })
}

/**
 * 采购订单作废
 */
export function jxcPurchaseSetStateByIdsAPI(data) {
  return request({
    url: 'jxcPurchase/setStateByIds',
    method: 'post',
    data: data
  })
}
